package com.tengju.bff.interfaces.covercharge.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 签约身份枚举
 *
 * @author zhaoyi
 */
@Getter
@AllArgsConstructor
public enum SignIdentityEnum {

    /**
     * 无身份
     */
    no_identity("no_identity", -1, "无身份"),

    /**
     * 个人
     */
    person("person", 0, "个人"),

    /**
     * 注册个体户
     */
    regist_soho("regist_soho", 3, "注册个体户"),

    /**
     * 自认证个体户
     */
    certified_individual("certified_individual", 2, "自认证个体户"),

    /**
     * 自认证企业
     */
    certified_business("certified_business", 1, "自认证企业");

    private String code;

    private Integer type;

    private String desc;


    public static SignIdentityEnum getStatusDesc(String code) {
        for (SignIdentityEnum thisEnum : (SignIdentityEnum.values())) {
            //如果传入的code与此枚举code相同，则返回此枚举
            if (thisEnum.getCode().equals(code)) {
                return thisEnum;
            }
        }
        return null;
    }
}
